#ifndef WEBSERVER_H
#define WEBSERVER_H

#include <iostream>
#include <sys/errno.h>
#include <sys/types.h>          /* See NOTES */
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/sendfile.h>
#include <string.h>
#include <string>
#include <stdio.h>
class WebServer{

    public:
        WebServer();
        ~WebServer();
        int Socket(int family, int type, int protocol);
        void Listen(int &sockfd, int backlog);
        void Bind(int &sockfd, const struct sockaddr *myaddr, socklen_t addrlen);
        int  Accept(int &sockfd, sockaddr *cliaddr, socklen_t *addrlen);
        void doMain();
    private:
        // int sockFd;//监听描述符
        // int connFd;//连接描述符
        struct sockaddr_in serverAddr,clientAddr;//服务端地址，客户端地址
};
#endif